package com.novax.ex.activity.open.api.inner;

import com.novax.ex.activity.open.model.response.RankSubConfigResponse;
import com.novax.ex.common.results.ReturnResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * summary: IEO后台-活动配置
 *
 * @author shaw
 * @date 11/30/22 11:14
 */
@Tag(name = "排名赛子活动配置", description = "排名赛子活动配置")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "RankSubConfigApi", contextId = "RankSubConfigApi")
public interface RankSubConfigApi {

    @Operation(summary = "排名赛活动配置分页查询")
    @GetMapping("/v3/private/rank-sub/{rankId}")
    ReturnResult<List<RankSubConfigResponse>> subList(@PathVariable("rankId") Long rankId);

    @Operation(summary = "排名赛活动配置修改")
    @Parameters({
        @Parameter(name = "rankSubId", description = "排名赛子活动配置id", in = ParameterIn.PATH),
        @Parameter(name = "number", description = "当前参赛人数 or 奖池")
    })
    @PostMapping("/v3/private/rank-sub/{rankSubId}")
    ReturnResult<?> modify(@RequestHeader("language") String language,
                           @PathVariable("rankSubId") Long rankSubId,
                           @RequestParam("number") Integer number);

}